﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TS_XY_Train_Repaire.Pub
{
    public partial class ProgressBarForm : Form
    {
        public int iMaxValue = 0;
        public string sName = "--";
        public ProgressBarForm()
        {
            InitializeComponent();
        }
        public void SetProgressValue(int value)
        {
            this.progressBar_1.Value = value;
            this.lb_1.Text = "当前进度 :（" + value.ToString() + "/" + progressBar_1.Maximum.ToString() + "）" + (value * 100 / progressBar_1.Maximum).ToString() + "%";
            this.lb_2.Text = "正在处理：" + sName;

            // 这里关闭，比较好，呵呵！  
            if (value >= this.progressBar_1.Maximum) this.Close();
        }

        private void ProgressBarForm_Load(object sender, EventArgs e)
        {
            this.progressBar_1.Maximum = iMaxValue;
        }
    }
}
